<!DOCTYPE html>
<html lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui">
<meta name="keywords" content="LightYear,LightYearAdmin,光年,后台模板,后台管理系统,光年HTML模板">
<meta name="description" content="Light Year Admin V5是一个基于Bootstrap v5.1.3的后台管理系统的HTML模板。">
<title>文档列表 - 光年(Light Year Admin V5)后台管理系统模板</title>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-touch-fullscreen" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="default">
<link rel="stylesheet" type="text/css" href="__STATIC__/admin/css/materialdesignicons.min.css">
<link rel="stylesheet" type="text/css" href="__STATIC__/admin/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="__STATIC__/admin/css/style.min.css">

<link rel="stylesheet" type="text/css" href="__STATIC__/common/cch.css">
</head>
  
<body>
<div class="container-fluid">
  
  <div class="row">
    
    <div class="col-lg-12">
      <div class="card">
        <div class="card-body">
          <div class="card-search mb-2-5">
            <form class="search-form" method="get" action="{:url('index')}" >
              
              {include file="html/search" /}
              
            </form>
          </div>
          <div class="card-btns mb-2-5">
            <a class="btn btn-primary me-1 search_btn" href="#!"><i class="mdi mdi-magnify"></i> 搜索</a>
            <a class="btn btn-info export_btn" href="javascript:void(0)"><i class="mdi mdi-arrow-collapse-down"></i> 导出</a>
            <!-- <a class="btn btn-success me-1" href="{:url('add')}"><i class="mdi mdi-plus"></i> 新增</a> -->
            <a class="btn btn-success" href="javascript:void(0)" data-bs-toggle="modal" data-bs-target="#modal-add"><i class="mdi mdi-plus"></i> 新增</a>
            <a class="btn btn-danger more_delete_btn" href="#!" data-url='{:url("moreDelete",[],"")}'><i class="mdi mdi-window-close"></i> 删除</a>
          </div>

          
          <div class="table-responsive">
            <table class="table table-bordered">
              <thead>
                <tr>
                  <th>
                    <div class="form-check">
                      <input class="form-check-input" type="checkbox" id="check-all">
                      <label class="form-check-label" for="check-all"></label>
                    </div>
                  </th>
                  <th>申请名称</th>
                  <th>申请人</th>
                  <th>申请日期</th>
                  <th>审批人</th>
                  <th>审批时间</th>
                  <th>当前状态</th>
                  <th>操作</th>
                </tr>
              </thead>
              <tbody>
                <?php if (empty($list['data'])): ?>
                  <tr><td colspan="100" class="text-center">暂无数据</td></tr>
                <?php else: ?>
                  <?php foreach ($list['data'] as $k => $vo): ?>
                    <tr>
                      <td>
                        <div class="form-check">
                          <input type="checkbox" class="form-check-input ids" name="ids[]" value="{:$vo['id']}" id="ids-{:$vo['id']}">
                          <label class="form-check-label" for="ids-{:$vo['id']}"></label>
                        </div>
                      </td>
                      <td>{:$vo['name']}</td>
                      <td>{:$vo['c_admin']}</td>
                      <td>{:timeDef($vo['ctime'])}</td>
                      <td>{:$vo['sp_admin']}</td>
                      <td>{:timeDef($vo['utime'])}</td>
                      <td>{:$model->getStatusCn($vo['status'])}</td>
                      <td>
                        <div class="btn-group btn-group-sm">
                          <a class="btn btn-default" href="{:url('edit',['id'=>$vo['id']])}" data-bs-toggle="tooltip" title="编辑"><i class="mdi mdi-pencil"></i></a>
                          <?php if ($vo['status'] == 0): ?>
                            <a class="btn btn-default" href="{:url('changeStatus',['id'=>$vo['id'],'status'=>1])}" data-bs-toggle="tooltip" title="通过"><i class="mdi mdi-check"></i></a>
                            <a class="btn btn-default" href="{:url('changeStatus',['id'=>$vo['id'],'status'=>-1])}" data-bs-toggle="tooltip" title="拒绝"><i class="mdi mdi-close"></i></a>
                          <?php endif ?>
                          <a class="btn btn-default delete_btn" href="{:url('delete',['id'=>$vo['id']])}" data-bs-toggle="tooltip" title="删除"><i class="mdi mdi-delete"></i></a>
                        </div>
                      </td>
                    </tr>
                  <?php endforeach ?>
                <?php endif ?>
              </tbody>
            </table>
          </div>

          {$page|raw}
          
          
        </div>
      </div>
    </div>
        
  </div>
  
</div>

<!--新增申请-->
<div class="modal " data-bs-backdrop="static" tabindex="-1" id="modal-add">
  <div class="modal-dialog modal-dialog-centered">
    <div class="modal-content">
      <div class="modal-header">
        <h6 class="modal-title">申请表</h6>
        <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
      </div>
      <div class="modal-body" style="padding-top:0.5rem;">
        <form action="" method="post" id="office_content">
          <input type="hidden" name="order_id" value="" />
          
          <div class="row mb-3">
            <?php $field = 'xzform_id'; $vo = ['name'=>'表单','type'=>'select1_1','params'=>$xzforms]; ?>
            <div class="col-md-12">
              {include file="html/fields/select1" /}
            </div>

          </div>
        </form>  
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">关闭</button>
        <button type="button" class="btn btn-primary" onclick="addData()" data-bs-dismiss="modal">保存</button>
      </div>
    </div>
  </div>
</div>


<script type="text/javascript" src="__STATIC__/admin/js/jquery.min.js"></script>
<script type="text/javascript" src="__STATIC__/admin/js/popper.min.js"></script>
<script type="text/javascript" src="__STATIC__/admin/js/bootstrap.min.js"></script>
<script type="text/javascript" src="__STATIC__/admin/js/main.min.js"></script>
<!--自定义扩展-->
<script type="text/javascript" src="__STATIC__/common/cch.js"></script>
<script type="text/javascript" src="__STATIC__/common/cch-util.js"></script>
<script type="text/javascript">
  function addData(){
    var xzform_id = $("#modal-add").find('select[name="xzform_id"]').val();
    console.log(xzform_id)
    if (xzform_id <= 0 || xzform_id == null) {
      cchUtil.message('请选择表单','danger');
      return false;
    }
    window.location.href = '{:url('add',[],'')}?xzform_id='+xzform_id;
  }
</script>
</body>
</html>